----------------------------------Spell Variables--------------------------------------
SPELL.m_iSpellID = 70011 -- Whatever value you want as long as it doesn't override any other spells' IDs.
SPELL.m_iRange = 128
SPELL.m_sName = "Self-Mend"
SPELL.m_sToolTip =	[[Heal yourself for
					  60 points of damage.]]
SPELL.m_sIcon = "devin/blackbetty/spells/warrior/shieldregen.png"
SPELL.m_iCoolDown = 4
SPELL.m_iManaCost = 40
SPELL.m_bRequiresTarget = false
SPELL.m_iSpellType = SPELLTYPE_UTILITY

---------------------------------------------------------------------------------------

function SPELL:Cast( pl, target )
	local range = self.m_iRange
	
	print("Casted "..self.m_sName.."!")
		
	if(pl && pl:IsValid()) then
		pl:EmitSound("devin/blackbetty/weapons/castsounds/HolyCast.wav", 100, 100)
		ParticleEffectAttach( "light_hands_instacast", PATTACH_POINT_FOLLOW, pl, pl:LookupAttachment("anim_attachment_RH"))
			
		timer.Simple(0.15, function()
		
			pl:EmitSound("devin/blackbetty/weapons/HolyLight.wav", 100, 100+math.random(-10,10))
			ParticleEffect( "impact_light_heal", pl:GetPos(), Angle(0,0,0), pl )
			if(SERVER)then
				local dmginfo_fbst = DamageInfo()
					dmginfo_fbst:SetDamage( -30 ) 
					dmginfo_fbst:SetDamageType( DMG_POISON)
					dmginfo_fbst:SetAttacker( pl ) 
					dmginfo_fbst:SetDamageForce( Vector( 0, 0, 1000 ) ) 
				pl:TakeDamageInfo( dmginfo_fbst )
			end
			pl:SetNWBool("Casting", false)
			pl:SetNWBool("Casted", false)
			
		end)
	end
end




